# -*- coding: utf-8 -*-

# Define here the models for your scraped items
#
# See documentation in:
# https://doc.scrapy.org/en/latest/topics/items.html

import scrapy


class TenxunzhaopingItem(scrapy.Item):
    url = scrapy.Field()   # 职位详情链接
    title = scrapy.Field()   # 标题
    location = scrapy.Field()   #工作地点
    ptype = scrapy.Field()    # 职位类别
    number = scrapy.Field()  # 招聘人数
    duty = scrapy.Field()   # 职位职责
    spider = scrapy.Field()


    def get_sql(self):
        sql = 'insert into tencent(url,title,location,ptype,number,duty,spider)value (%s,%s,%s,%s,%s,%s,%s)'
        data = (self['url'],self['title'],self['location'],self['ptype'],self['number'],self['duty'],self['spider'])
        return sql, data